import { OnInit, Component, Input, Output, EventEmitter } from '@angular/core';
import { Router } from '@angular/router';
import { Song } from 'src/app/routes/entity';

@Component({
  selector: 'app-song-sheet-list',
  templateUrl: './song-sheet-list.component.html',
  styleUrls: ['./song-sheet-list.component.less']
})
export class SongSheetListComponent implements OnInit {

  @Input()
  sheetList: Song[] = [];

  @Output()
  onPlaySheet = new EventEmitter<number>();

  constructor(
    private router: Router
  ) { }

  ngOnInit(): void {
  }

  onPlaySheetEvent(id: number): void {
    this.onPlaySheet.emit(id);
  }

  routerToDetail(id: number): void {
    console.log('res');
    this.router.navigate(['/music/sheets', id, '/detail']);
  }


}